package com.feishi.project.webbase.service;

import com.feishi.project.webbase.bean.Student;
import com.feishi.project.webbase.bean.User;
import com.feishi.project.webbase.dao.StudentDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: caixq
 * Date: 2019-03-04
 * Time: 下午4:17
 */
@Component
public class UserService {
    @Autowired
    private StudentDao studentDao;

    public User getUserByName(String username) {
        if(username.equals("admin")){
            User user=new User();
            user.setName(username);
            user.setPassword("123456");
            user.setRole("admin");
            return user;
        }
        studentDao.getStudentByName(username);

        return null;
    }
}
